﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComLib.ConfigService;
using ComLib.ComType;
using ProcessConfig;

namespace ConfigManager.TabPages
{
    public partial class TabPageBase : UserControl
    {
        public delegate void VisaEnabledEventHandler(object sender, VisaEnabledEventArgs e);
        public delegate void ChangeQCEventHandler(object sender, QCEventArgs e);

        public TabPageBase()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 初始化是否完成
        /// </summary>
        protected static bool _bInitCompleted = false;
        public static bool InitCompleted
        {
            get { return _bInitCompleted; }
            set { _bInitCompleted = value; }
        }

        protected static ConfigService _config = ConfigService.GetInstance();
        public static ConfigService Config
        {
            get { return _config; }
            set { _config = value; }
        }

        public virtual void InitCtrls()
        {

        }

        public virtual void Exit()
        {

        }

        public virtual bool UpdateData()
        {
            return false;
        }

    }

    /// <summary>
    /// 一所质检参数变更事件
    /// </summary>
    public class QCEventArgs : EventArgs
    {
        public readonly bool EnableChanged;
        public readonly bool QCEnabled;
        public QCEventArgs(bool enableChanged, bool enabled)
        {
            this.EnableChanged = enableChanged;
            this.QCEnabled = enabled;
        }
    };

    /// <summary>
    /// 预受理
    /// </summary>
    public class YSLEnabledEventArgs : EventArgs
    {
        public readonly bool Enabled;
        public YSLEnabledEventArgs(bool val)
        {
            this.Enabled = val;
        }
    };

    /// <summary>
    /// 是否刷身份证
    /// </summary>
    public class IDCardEnabledEventArgs : EventArgs
    {
        public readonly bool Enabled;
        public IDCardEnabledEventArgs(bool val)
        {
            this.Enabled = val;
        }
    };

    /// <summary>
    /// 是否启用联网平台
    /// </summary>
    public class ZWPEnabledEventArgs : EventArgs
    {
        public readonly bool Enabled;
        public readonly bool IDCardChecked;
        public ZWPEnabledEventArgs(bool val, bool idCard)
        {
            this.Enabled = val;
            this.IDCardChecked = idCard;
        }
    };

    /// <summary>
    /// 口岸拍照
    /// </summary>
    public class VisaEnabledEventArgs : EventArgs
    {
        public readonly bool Enabled;
        public readonly bool IDCardEnabled;
        public VisaEnabledEventArgs(bool val0, bool val1)
        {
            this.Enabled = val0;
            IDCardEnabled = val1;
        }
    };
}
